clear all
close all

%paramters
beta = exp(-.012)
mu = .02
sigma = .02 
lambda = 3
gamma = 1

rho = .8

%do this for now, later work with model with variable p
b = .4;

Phi = beta*exp((1-gamma)*mu + .5*(1- gamma)^2*sigma^2)
r = -log(beta) + gamma*mu - .5*gamma^2*sigma^2 



p = 0


Phi0 = Phi*(exp(-p) + (1-exp(-p))*(1-b)^(lambda-gamma))

PD0 = Phi0/(1-Phi0)

r0 = r - p*((1-b)^(-gamma)-1)




p = 1-rho

Phi1 = Phi*(exp(-p) + (1-exp(-p))*(1-b)^(lambda-gamma))

PD1 = Phi1/(1-Phi1)

r1 = r - p*((1-b)^(-gamma)-1)

pricechange = (Phi1-Phi0)/Phi0
pricechange = (PD1-PD0)/PD0

